﻿
<%namespace YouHP.Model%>
<%namespace YouHP.Utility%>
<%namespace YouHP.Model.Group%>

<%template _Header%>
<script type="text/javascript">

var query = location.href.substring(location.href.indexOf("?")); 

function loadCommentList()
{
  
  var aurl = "/Pages/alpha/Ajax/CommentConversationAjax.aspx"+query+"&page=1";
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      _$("commentList").innerHTML=html;
      }
   }
   );
   myAjax.request();
  
  
}  

function ViewCommentPage(pageindex)
{
  
  var aurl = "/Pages/alpha/Ajax/CommentConversationAjax.aspx"+query+"&page="+pageindex;
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      _$("commentList").innerHTML=html;
      }
   }
   );
   myAjax.request();
  
  
} 


 
function CommentDelete(id)
{
  
  var aurl = "/Pages/alpha/Ajax/CommentConversationDeleteAjax.aspx"+query+"&id="+id;
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      _$("commentList").innerHTML=html;
      }
   }
   );
   myAjax.request();
  
  
} 

function CommentReplyAdd(toUserId)
{
    var query = location.href.substring(location.href.indexOf("?"));
    var replycontent = _$("replycontent").value;
      
        if (replycontent.length == 0)
        {
            alert("回复内容不能为空！");
            return;
        }
        if(replycontent.length > 300 ) 
        {
            alert("回复内容不能超过300个字！");
            return;
        }
      
      var aurl = "/Pages/alpha/Ajax/CommentConversationReplyAddAjax.aspx"+query+"&replycontent="+replycontent.escUrl()+"&toUserId="+toUserId;
      var myAjax=new Ajax(aurl,
      {
         method:'get',
         onComplete:function()
         {
           var html=this.response.text;
           _$("commentList").innerHTML=html;
           _$('replycontent').value = "";
          }
       }
       );
       myAjax.request();
}

loadCommentList();

function replyadd()
{
   _$('replycontent').focus();
}

var v=getURLParam("reply", location.href);
if(v==1)
{
   window.onload = replyadd;
}
</script>


<div class="layout2-cols2">
<%template _memmenu%>
	<div class="pannelcontent">

		<div class="pcontent">
		<div class="panneldetail">
		<div class="pannelbody">
		

	    <div class="box">
	    <div class="pl"id="commentList">
        
                <div style="padding:20px 50px;">
                <%csharp%> TempUrl = "/images/indicator_medium.gif";<%/csharp%>
                <img src="{this.GetResource(TempUrl)}" /><b>正在加载……</b>

                </div>

	    </div>     
	    </div>
	    
  
        <div id="plshow">
        <div class="bor"> 
        <textarea  width="80%" cols="80" rows="6" id="replycontent" class="rev_textarea"></textarea>
        </div>
        <%if CommentData.PostUserId==UserData.Id%>
        <input type="button" value="回复" onClick="CommentReplyAdd({CommentData.HostUserId});" />
        <%else%>
        <input type="button" value="回复" onClick="CommentReplyAdd({CommentData.PostUserId});" />
        <%/if%>
        </div>
  
	    
	    

</div>
</div>
</div>
	    
      
</div> 
</div>


<%template _footer%>		
